package com.czy.owner.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import com.czy.owner.R;
import com.czy.owner.entity.PunchRecordModel;
import com.easyrecycleview.adapter.BaseViewHolder;
import com.easyrecycleview.adapter.RecyclerArrayAdapter;


/**
 * Created by wangyang on 2017/4/20 0020.
 */

public class PunchRecordSubAdaper extends RecyclerArrayAdapter<PunchRecordModel.OrderItemsBean> {

    private Context ctx;

    public PunchRecordSubAdaper(Context context) {
        super(context);
        this.ctx = context;
    }

    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return new punpunchRecorSubViewHolder(parent);

    }

    class punpunchRecorSubViewHolder extends BaseViewHolder<PunchRecordModel.OrderItemsBean> {
        private TextView tv_name;
        private TextView tv_count;

        public punpunchRecorSubViewHolder(ViewGroup parent) {
            super(parent, R.layout.item_sub_goods_service);
            tv_name = $(R.id.tv_name);
            tv_count = $(R.id.tv_count);

        }

        @Override
        public void setData(PunchRecordModel.OrderItemsBean model) {
            tv_name.setText(model.getItemName());
            tv_count.setText("x" + model.getCount());

        }

    }
}
